<html>
<#include "../common/header.ftl">

<body>
<div id="wrapper" class="toggled">

    <#--边栏sidebar-->
    <#include "../common/nav2.ftl">


    <#--主要内容content-->
    <div id="page-content-wrapper">
        <div class="container">
            <div class="row clearfix">
                <div class="col-md-4 column">
                    <table class="table table-bordered">
                        <thead>
                        <tr>
                            <th>发货单号</th>
                            <th>货单金额</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr>
                            <td>${sendDetailDto.sendId}</td>
                            <td>${sendDetailDto.sendProductsMoney}</td>
                        </tr>
                        </tbody>
                    </table>
                </div>

                <#--订单详情表数据-->
                <div class="col-md-12 column">
                    <table class="table table-bordered">
                        <thead>
                        <tr>
                            <th>商品id</th>
                            <th>商品小图</th>
                            <th>商品名称</th>
                            <th>库存</th>
                            <th>发货数目</th>
                            <th colspan="5" >状态</th>
                        </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td>${sendDetailDto.productId}</td>
                                <td><img height="100" width="120" src="${sendDetailDto.productIcon}" alt=""></td>
                                <td>${sendDetailDto.productName}</td>
                                <td>${sendDetailDto.productStock}</td>
                                <td>${sendDetailDto.productQuantity}</td>
                                <td>
                                <#if (sendDetailDto.productQuantity > sendDetailDto.productStock)>
                                    <div class="col-md-12 column">
                                        <a href="#">库存不足</a>
                                    </div>
                                <#elseif ((sendDetailDto.productStock-sendDetailDto.productQuantity)<stockmin)>
                                    <div class="col-md-12 column">
                                        <a href="#" >库存低于阈值</a>
                                    </div>
                                <#else>
                                    <div class="col-md-12 column">
                                        <a href="#" >可正常发货</a>
                                    </div>
                                </#if>
                                </td>
                            </tr>
                        <#--操作-->
                        </tbody>

                    </table>
                </div>

                <#if (sendDetailDto.productQuantity < sendDetailDto.productStock)&&((sendDetailDto.productStock-sendDetailDto.productQuantity)>stockmin)>
                <div class="col-md-12 column pull-left" style="margin-left: 896px;" >
                    <button ><a type="button" class="btn btn-default btn-primary" href="/sell/seller/sendProduct/saveSend?sendId=${sendDetailDto.sendId}">确认发货</a></button>
                    <button class="btn btn-defaul t" ><a href="/sell/seller/sendProduct/purchase?productQuantity=${sendDetailDto.productQuantity}&productId=${sendDetailDto.productId}">进货</a></button>
                </div>
                    <#else>
                        <div class="col-md-12 column pull-left" style="margin-left: 896px;" >
                            <button class="btn btn-default " > <a href="#" >确认发货</a></button>
                            <button  ><a type="button" class="btn btn-default btn-primary" href="/sell/seller/sendProduct/purchase?productQuantity=${sendDetailDto.productQuantity}&productId=${sendDetailDto.productId}">进货</a></button>
                        </div>
                </#if>
            </div>
        </div>
    </div>
</div>

</body>
</html>